<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<title>WFS-T</title>
		
		<link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" />
	 	<link rel="stylesheet" type="text/css" href="../../resources/css/style.css" />   
    
    <script type="text/javascript" src="../../resources/ext/ext-base.js"></script>
    <script type="text/javascript" src="../../resources/ext/ext-all.js"></script>
    
    <script src="http://www.openlayers.org/api/2.9/OpenLayers.js"></script>
    <script type="text/javascript" src="../../resources/ext/GBIF.GeoSpatial.Notice.js"></script>
    <script type="text/javascript" src="../../resources/ext/CheckboxSelectionModel.js"></script>
    
    <script type="text/javascript" src="../../resources/ext/ext.ux.datatip.js"></script>
    
    <script type="text/javascript" src="../../resources/ext/GBIF.GeoSpatial.CopyLink.js"></script>
    <script type="text/javascript" src="../../resources/ext/TreeCheckbox.js"></script>
    <script type="text/javascript" src="../../resources/ext/TriStateNodeUI.js"></script>
    <script type="text/javascript" src="../../resources/ext/GBIF.GeoSpatial.GeoRSS.js"></script>
    <script type="text/javascript" src="../../resources/ext/GBIF.GeoSpatial.SelectFeature.js"></script>
    <script type="text/javascript" src="../../resources/ext/GBIF.GeoSpatial.RemoveFeature.js"></script>
    <script type="text/javascript" src="../../resources/geoext/script/GeoExt.js"></script>
    <script type="text/javascript" src="../../resources/js/GBIF.GeoSpatial.Language.js"></script>
    <script type="text/javascript" src="../../resources/js/GBIF.GeoSpaital.LayersTree.js"></script>
		<script type="text/javascript" src="../../resources/js/GBIF.GeoSpaital.MappingLayers.js"></script>
		<script type="text/javascript" src="../../resources/js/datapanel/GBIF.GeoSpatial.GeoRssKmlDataPanel.js"></script>
		<script type="text/javascript" src="../../resources/js/datapanel/GBIF.GeoSpatial.Console.js"></script>
		<script type="text/javascript" src="../../resources/js/datapanel/GBIF.GeoSpatial.DataGrid.js"></script>
		<script type="text/javascript" src="../../resources/js/datapanel/GBIF.GeoSpatial.LegendPanel.js"></script>
		<script type="text/javascript" src="../../resources/js/datapanel/GBIF.GeoSpatial.FeatureDataGrid.js"></script>
		
		<script type="text/javascript" src="../../resources/js/GBIF.GeoSpatial.TabManager.js"></script>
		<script type="text/javascript" src="../../resources/js/GBIF.GeoSpatial.AvailableLayersTree.js"></script>
		<script type="text/javascript" src="../../resources/js/GBIF.GeoSpatial.GeoMapPanel.js"></script>
		<script type="text/javascript" src="../../resources/js/GBIF.GeoSpatial.CenterPanel.js"></script>
		<script type="text/javascript" src="../../resources/js/GBIF.GeoSpatial.Container.js"></script>
		<script type="text/javascript" src="../../resources/js/GBIF.GeoSpatial.GeoSpatialPortal.js"></script>
		
		<script type="text/javascript" src="../../resources/language/GBIF.GeoSpatial-lang-en.js"></script>
		<script type="text/javascript" src="../../config.js"></script>
</head>
<body>
		<script type="text/javascript">
			GBIF.GeoSpatial.BUS = new Ext.util.Observable();
			Ext.onReady(function() {

				Config.GBIF.GeoSpatial.TabManager.tabConfig.consoleShow = false;
				Config.GBIF.GeoSpatial.TabManager.tabConfig.georssShow = false;
				Config.GBIF.GeoSpatial.TabManager.tabConfig.legendShow = false;
				
				Config.GBIF.GeoSpatial.CenterPanel.controlConfig.polygonControl = true;
				Config.GBIF.GeoSpatial.CenterPanel.controlConfig.deleteControl = true;
				Config.GBIF.GeoSpatial.CenterPanel.controlConfig.modifyControl = true;
				Config.GBIF.GeoSpatial.CenterPanel.controlConfig.selectControl = true;
				
				// Disable browser right click
				Ext.fly(document.body).on('contextmenu', function(e, target) {
					e.preventDefault();
				});

				var GeoPortal = new GBIF.GeoSpatial.GeoSpatialPortal();
				
				var wms = new Ext.Viewport({
						layout: 'border'
					,	renderTo: Ext.getBody()
					,	items: [ GeoPortal ]
				});
				
				OpenLayers.ProxyHost = "/cgi-bin/proxy.cgi?url=";	
				
				var wfs = GeoPortal.addWFSLayerToMap({											 
						layer: 'WFS'
					,	text: 'Polygon Example'
					,	mType: 'WFS'
					,	editable: true
					,	url: "http://demo.opengeo.org/geoserver/wfs"
					,	featureType: "restricted"
					,	featureNS: "http://opengeo.org"
					,	geometryName: "the_geom"
					,	schema: "http://demo.opengeo.org/geoserver/wfs/DescribeFeatureType?version=1.1.0&typename=og:restricted"
				});
				
				GeoPortal.centerPanel.currentWFST = wfs;				
				GeoPortal.centerPanel.mapComponent.map.addLayer( wfs );
		    GeoPortal.centerPanel.moveMapToCenter(-90, 30);

		});
		</script>
</body>
</html>